<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCourseSectionWorksTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //章节作业
        Schema::create('course_section_works', function (Blueprint $table) {
            $table->id();
            $table->unsignedInteger('course_id')->comment("课程id");
            $table->unsignedInteger('course_section_id')->comment("课程章节id");
            $table->unsignedInteger('users_id')->comment("上传用户id");
            $table->unsignedInteger('school_id')->comment("学校id");
            $table->unsignedInteger('class_grades_id')->comment("班级id");
            $table->string('name')->comment("名称");
            $table->string('work_file')->comment("作业");

            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('course_section_works');
    }
}
